import request from '@/utils/request'


// 查询 定价配置列表
export function getPricUserPriceList(query) {
    return request({
        url: '/pricing/pricingConfigAuthor/queryPricingUserAuthorByPage.action',
        method: 'get',
        params: query
    })
}

// 设置默认配置
export function setDefaultCfg(param) {
    return request({
        url: '/pricing/pricingConfigAuthor/setDefaultCfg.action',
        method: 'get',
        params: param
    })
}



// 查询 用户组列表 priceId
export function getPricUserPriceById(priceId) {
    return request({
        url: '/pricing/pricingUserPrice/getPricUserPriceById.action',
        method: 'get',
        params: {"priceId": priceId}
    })
}

// 新增
export function addPricUserPrice(param) {
    return request({
        url: '/pricing/pricingUserPrice/addPricUserPrice.action',
        method: 'get',
        params: param
    })
}

// 修改 用户组
export function updatePricUserPrice(query) {
    return request({
        url: '/pricing/pricingUserPrice/updatePricUserPrice.action',
        method: 'get',
        params: query
    })
}

// 删除 用户组
export function deletePricUserPrice(priceIds) {
    return request({
        url: '/pricing/pricingUserPrice/deletePricUserPrice.action',
        method: 'get',
        params: {"priceIds": JSON.stringify(priceIds)}
    })
}

// 查询 用户
export function findUserList(query) {
    return request({
        url: '/pricing/pricingUserPrice/findUserList.action',
        method: 'get',
        params: query
    })
}

// 查询 组内用户
export function findInUserList(query) {
    return request({
        url: '/pricing/pricingUserPrice/findInUserList.action',
        method: 'get',
        params: query
    })
}

// 查询 组外用户
export function findOutUserList(query) {
    return request({
        url: '/pricing/pricingUserPrice/findOutUserList.action',
        method: 'get',
        params: query
    })
}

//
export function dealTransferUser(query) {
    return request({
        url: '/pricing/pricingUserPrice/dealTransferUser.action',
        method: 'get',
        params: query
    })
}


// 查询 定价配置用户列表
export function queryPricingConfigAuthorByPage(query) {
    return request({
        url: '/pricing/pricingConfigAuthor/queryPricingConfigAuthorByPage.action',
        method: 'get',
        params: query
    })
}

//查询 定价配置用户组列表
export function queryGroupPricingConfigAuthorByPage(params) {
    return request({
        url: '/pricing/pricingConfigAuthor/queryGroupPricingConfigAuthorByPage.action',
        method: 'get',
        params: params
    })
}

// 查询 定价配置用户 权限
export function queryPricingUserAuthorByPage(query) {
    return request({
        url: '/pricing/pricingConfigAuthor/queryPricingUserAuthorByPage.action',
        method: 'get',
        params: query
    })
}

// 定价配置 同步
export function executePricingConfigSyncAuthor(query) {
    return request({
        url: '/pricing/pricingConfigAuthor/executePricingConfigSyncAuthor.action',
        method: 'get',
        params: query
    })
}

// 定价配置 新增
export function savePricingConfig(params) {
    return request({
        url: '/pricing/pricingConfigAuthor/savePricingConfig.action',
        method: 'get',
        params: params
    })
}

// 定价配置 更新
export function updatePricingConfig(params) {
    return request({
        url: '/pricing/pricingConfigAuthor/updatePricingConfig.action',
        method: 'get',
        params: params
    })
}

// 定价配置 删除
export function deletePricingConfig(param) {
    return request({
        url: '/pricing/pricingConfigAuthor/deletePricingConfig.action',
        method: 'get',
        params: param
    })
}

//  定价配置 更新
export function updatePricingConfigUserAuthor(params) {
    return request({
        url: '/pricing/pricingConfigAuthor/updatePricingConfigUserAuthor.action',
        method: 'post',
        data: params
    })
}

//  定价配置 删除
export function deletePricingConfigUserAuthor(query) {
    return request({
        url: '/pricing/pricingConfigAuthor/deletePricingConfigUserAuthor.action',
        method: 'get',
        params: query
    })
}

//  定价配置 更新默认配置
export function updateUserDefaultPricingParam(query) {
    return request({
        url: '/pricing/pricingConfigAuthor/updateUserDefaultPricingParam.action',
        method: 'get',
        params: query
    })
}


/**查询有当前定价id的部门和用户 */
export function getCfgUserAndDpetPerm(query){
    return request({
        url: '/pricing/pricingConfigAuthor/queryCfgUserAndDeptPerm.action',
        method: 'get',
        params: query
    })
}


/** 修改定价id的权限 */
export function updateCfgPerm(data){
    return request({
        url: '/pricing/pricingConfigAuthor/updateCfgPerm.action',
        method: 'post',
        params: data
    })
}

//查询当前登录用户的有权限的部门下的所属用户
export function listAllocateUser(query){
    return request({
      url: '/system/user/listCfgAllocateUser',
      method: 'get',
      params: query
    })
  }

  // 查询用当前定价参数的合约和标的数量
export function querySubCfgCountByCfgId(query) {
    return request({
        url: '/pricing/pricingConfigAuthor/querySubCfgCountByCfgId.action',
        method: 'get',
        params: query
    })
    }